package com.transcoachapp;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.Toast;
import android.widget.AdapterView.OnItemSelectedListener;

public class SettingsActivity extends Activity {
	public String className;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_settings);
		Bundle extras = getIntent().getExtras();
		className = extras.getString("className");
		Toast.makeText(this, className, Toast.LENGTH_LONG).show();
		Spinner list = (Spinner) findViewById(R.id.spinner1);
		ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.Seyahat_Kart_Tipi, android.R.layout.simple_spinner_dropdown_item);
		list.setAdapter(adapter);
		OnItemSelectedListener chose = new OnItemSelectedListener() {

			@Override
			public void onItemSelected(AdapterView<?> arg0, View arg1,
					int arg2, long arg3) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void onNothingSelected(AdapterView<?> arg0) {
				// TODO Auto-generated method stub
				
			}
		};
		list.setOnItemSelectedListener(chose);
/*		
		/// cancel button
		Button cancel = (Button) findViewById(R.id.button1);
		cancel.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				startActivity(new Intent(SettingsActivity.this, className.getClass()));
			}
		});
	*/	
		Button save = (Button) findViewById(R.id.button2);
		save.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				//////////////////////////////////////////////
				/// write the actions when put save button
			}
		});
	
	}
}
